//
//  BBPixelBlob.h
//  BBBlobDetectTestbed
//
//  Created by ben smith on 3/16/08.
//  This file is part of BBTouch.
//
//  BBTouch is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.

//  BBTouch is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.

//  You should have received a copy of the GNU Lesser General Public License
//  along with BBTouch.  If not, see <http://www.gnu.org/licenses/>.
// 
//  Copyright 2008 Ben Britten Smith ben@benbritten.com .
//

#import <Cocoa/Cocoa.h>

// a blob made of a center point and a pixel count

@interface BBPixelBlob : NSObject {
	NSMutableArray * pixels;
	NSMutableArray * values;
	NSPoint center;
	int pixelMass; // the number of pixels in the blob
	int xMax,xMin,yMax,yMin;
	unsigned char valueMax,valueMin;
	BOOL invert;
}

@property (retain) NSMutableArray * pixels;
@property (retain) NSMutableArray * values;
@property (assign) unsigned char valueMax;
@property (assign) unsigned char valueMin;

@property (assign) BOOL invert;

@property (assign) int xMax;
@property (assign) int xMin;
@property (assign) int yMax;
@property (assign) int yMin;

@property (assign) int pixelMass;

@property (assign) NSPoint center;


+ (BBPixelBlob*)pixelBlob;
- (NSPoint)centerPoint;
- (NSRect)boundingRect;
- (NSString*)description;
- (float)radius;
- (id) init;
- (void)addPixel:(NSPoint)p;
- (void)addPixel:(NSPoint)p withValue:(unsigned char)value;
- (void)reset;

// 10 methods



@end
